package main

/*
@author: wy
@file: tree.py
@time: 2023/11/25 11:07
*/
import (
	"fmt"
	"io/ioutil"
)

func tree(path string, k string) {
	files, err := ioutil.ReadDir(path)
	if err != nil {
		println(err)
		return
	}
	for _, file := range files {
		if file.IsDir() {
			println(k, file.Name(), "/")
			tree(path+"\\"+file.Name(), k+"		")
		} else {
			println(k, file.Name())
		}

	}
}

func main() {
	var path string
	println("please input you want search:")
	fmt.Scanln(&path)
	tree(path, " ")
}
